﻿
using Dapper;
using HBase;
using System;
using System.Data;
namespace hCommand {
    public class WcsMoveTask : GkTransaction {
        public long completeId;
        public long paramId;
        public String waveNo;
        public int src;
        public int des;
        public String info;
        protected override TransRes Execute(IDbConnection connection ,IDbTransaction transaction) {
            CoreTask complete = new CoreTask();
            complete.id = completeId;
            complete.boxCode = "";
            complete.des = des;
            complete.src = src;
            complete.Status = (int)CoreTaskStatus.执行中;
            complete.info = String .IsNullOrEmpty(info)?( "从" + src + "到" + des):info;
            complete.createTime = DateTime.Now;
            complete.waveNo = waveNo;
            connection.InsertNoNull(complete ,transaction);
            CoreTaskParam completeParam = new CoreTaskParam();
            completeParam.id = paramId;
            completeParam.taskId = complete.id;
            completeParam.param = "";
            completeParam.type = ( int ) TaskParamType.托盘搬运;
            completeParam.des = des;
            completeParam.src = src;
            completeParam.cStn = src;
            completeParam.status = ( int ) CoreTaskParamStatus.可以接收任务;
            completeParam.taskNo = TaskNoUtil.getTaskNo(connection ,transaction);
            completeParam.createTime = DateTime.Now;
            connection.InsertNoNull(completeParam ,transaction);


            return new TransRes();
        }
    }
}
